Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCC-4428 - Pass item source in kebab case to hold forms #424

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

dgcohen
Copy link
Contributor

@dgcohen dgcohen commented Dec 20, 2024

Ticket:

This PR does the following:

  • We had missed a small bit of functionality on DFE that converts the source to kebab case before being sent in hold request params.

How has this been tested?

  • Added a unit test

Accessibility concerns or updates

  • NA

Checklist:

  • I updated the CHANGELOG with the appropriate information and JIRA ticket number (if applicable).
  • I have added relevant accessibility documentation for this pull request.
  • All new and existing tests passed.

Copy link

vercel bot commented Dec 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
research-catalog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 7:50pm

Copy link
Member

@EdwinGuzman EdwinGuzman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question

export const convertCamelToShishKabobCase = (str: string) =>
str
// Change capital letters into "-{lowercase letter}"
.replace(/([A-Z])/g, (c, p1, i) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the p1 and i for?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think i is the index needed to skip the first character, and p1 is a placeholder arg

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just updated these var names for clarity

src/models/Item.ts Outdated Show resolved Hide resolved
@dgcohen dgcohen merged commit a401427 into hold-pages Dec 20, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants